<template>
	<view class="pagesMy ">
		<scrollArticle v-if="scrollArticleShow" @closeScrollArticle='closeScrollArticle' codeId="perOrderList">
		</scrollArticle>
		<view class="content pagesPadding">
			<view class="cardBox" v-if="ordersList&&ordersList.length>0">
				<!-- <scroll-view :style="{height:contentheightData}" scroll-y="true" :refresher-enabled="false"
					:refresher-threshold="100" @scrolltolower='getReachBottom' @scroll="onScroll"> -->
				<view class="cardItem" v-for="(item, index) in ordersList" :key="index">

					<view class="cardItem_top">
						<view class="cardItem_top_left">
							<view class="cardItem_top_left_line">

							</view>
							<view class="cardItem_top_left_title color3" v-if='item.orderType == 1'>
								机构申请
							</view>
							<view class="cardItem_top_left_title" v-else
								:class="item.ningboOrderType == 3?'color2':item.ningboOrderType == 2?'color1':'color0'">
								{{ningboOrderTypeMap[item.ningboOrderType]}}
							</view>
						</view>
						<view class="cardItem_top_right">
							<view class="cardItem_top_right_btn"
								:style='colorordersStatusType(Number(item.ordersStatus))'>
								{{ordersStatusMap[item.ordersStatus]}}
							</view>
							<view v-if="item.ningboOrderType == 2">
								<view v-if="item.serviceStatus == 2" class="cardItem_top_right_btn"
									:style='colorType(Number(item.serviceStatus))'>
									已完成
								</view>
								<view v-else class="cardItem_top_right_btn" :style='colorType(Number(1))'>
									检测中
								</view>
							</view>
							<view v-if="!getBtnStatus('',item)&&item.ningboOrderType != 2"
								class="cardItem_top_right_btn" :style='colorType(Number(item.serviceStatus))'>
								{{serviceStatusMap[item.serviceStatus]}}
							</view>

						</view>
					</view>
					<view class="cardItem_top">
						<view class="cardItem_price" v-if="item.amount">
							已支付<text class='redPrice'>{{item.amount}}</text>元
						</view>
						<!-- 此判断可以去除项目检测加做提示 -->
						<template v-if="item.ordersStatus == 3 || item.ordersStatus == 4">
							<view v-if="item.uploadAllStatus||item.uploadAllStatus===0" class="cardItem_top_right_btn"
								:style='addColorType(Number(item.uploadAllStatus))'>
								{{uploadAllStatusMap[item.uploadAllStatus ]}}
							</view>
						</template>
					</view>
					<view class="orderItemSteps">
						<view class="" v-if="item.ningboOrderType == 2">
							<u-steps :current="item.serviceStatus == 2 ? 3 : 1" >
								<u-steps-item title="申请"></u-steps-item>
								<u-steps-item title="检测中"></u-steps-item>
								<u-steps-item title="已完成"></u-steps-item>
							</u-steps>
						</view>
						<view class="" v-else>
							<view class="" v-if="getStepStatus(item.ordersStatus,item.serviceStatus)==1">
								<u-steps :current="getStepsValue(item.ordersStatus,item.serviceStatus)">
									<u-steps-item title="申请"></u-steps-item>
									<u-steps-item title="整理分配"></u-steps-item>
									<u-steps-item title="诊断中"></u-steps-item>
									<u-steps-item title="初诊结束"></u-steps-item>
									<u-steps-item title="加做支付"></u-steps-item>
									<u-steps-item title="加做诊断中"></u-steps-item>
									<u-steps-item title="诊断结束"></u-steps-item>
								</u-steps>
							</view>
							<view class="" v-else>
								<u-steps :current="getStepsValue(item.ordersStatus,item.serviceStatus)">
									<u-steps-item title="申请"></u-steps-item>
									<u-steps-item title="整理分配"></u-steps-item>
									<u-steps-item title="诊断中"></u-steps-item>
									<u-steps-item title="诊断结束"></u-steps-item>
								</u-steps>
							</view>
						</view>
					</view>
					<view class="cardItem_infosContaines">
						<view class="cardItem_infosContaines_content">
							<view class="cardItem_infosContaines_content_item">
								<view class="cardItem_infosContaines_content_item_label ">
									申请日期
								</view>
								<view class="cardItem_infosContaines_content_item_title">
									{{item.createTime}}
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item">
								<view class="cardItem_infosContaines_content_item_label ">
									订单ID
								</view>
								<view class="cardItem_infosContaines_content_item_title">
									{{item.id}}
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item">
								<view class="cardItem_infosContaines_content_item_label ">
									订单号
								</view>
								<view class="cardItem_infosContaines_content_item_title">
									{{item.orderNumber}}
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item" v-if="item.typeOfConsultationName">
								<view class="cardItem_infosContaines_content_item_label ">
									会诊类别
								</view>
								<view class="cardItem_infosContaines_content_item_title">
									{{item.typeOfConsultationName}}
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item" v-if="item&&item.patients">
								<view class="cardItem_infosContaines_content_item_label ">
									患者信息
								</view>
								<view class="cardItem_infosContaines_content_item_title_infos">
									<view class="cardItem_infosContaines_content_item_title_infos_name">
										{{item.patients[0].name}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="item.patients[0].sexName">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="item.patients[0].sexName">
										{{item.patients[0].sexName}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="item.patients[0].age">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="item.patients[0].age">
										{{item.patients[0].age}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="item.patients[0].cellphone">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="item.patients[0].cellphone">
										{{item.patients[0].cellphone}}
									</view>
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item">
								<view class="cardItem_infosContaines_content_item_label ">
									取材部位
								</view>
								<view class="cardItem_infosContaines_content_item_title_infos">
									<view class="cardItem_infosContaines_content_item_title_infos_name">
										{{item.patients[0].diagnosisHistory[0].visceraName}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="item.patients[0].diagnosisHistory[0].visceraName&&orderObj.patients[0].diagnosisHistory[0].diseaseLocation">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="item.patients[0].diagnosisHistory[0].diseaseLocation">
										{{item.patients[0].diagnosisHistory[0].diseaseLocation}}
									</view>
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item" v-if="item.orderType==1">
								<view class="cardItem_infosContaines_content_item_label ">
									送检信息
								</view>
								<view class="cardItem_infosContaines_content_item_title_infos">
									<view class="cardItem_infosContaines_content_item_title_infos_name">
										{{item.sendingHospitalName}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="item.sendingDoctor">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="item.sendingDoctor">
										{{item.sendingDoctor}}
									</view>
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item" v-else>
								<view class="cardItem_infosContaines_content_item_label ">
									送检信息
								</view>
								<view class="cardItem_infosContaines_content_item_title_infos">
									<view class="cardItem_infosContaines_content_item_title_infos_name">
										个人申请
									</view>
								</view>
							</view>
							<view class="cardItem_infosContaines_content_item">
								<view class="cardItem_infosContaines_content_item_label ">
									会诊信息
								</view>
								<view class="cardItem_infosContaines_content_item_title_infos">
									<view class="cardItem_infosContaines_content_item_title_infos_name">
										{{item.serviceCenterName}}
									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_line"
										v-if="getexpertName(item)">

									</view>
									<view class="cardItem_infosContaines_content_item_title_infos_name"
										v-if="getexpertName(item)">
										{{getexpertName(item)}}
									</view>
								</view>
							</view>
							<template
								v-if="(item.ordersStatus == 1 || item.ordersStatus == 4 || item.ordersStatus == 10 || item.ordersStatus == 12) && item.serviceStatus == 2">
							</template>
							<template v-else>
								<view v-if="item.timeout || item.remainder"
									class="cardItem_infosContaines_content_item">
									<view class="cardItem_infosContaines_content_item_label ">
										会诊倒计时
									</view>
									<view v-if="item.remainder && item.remainder > 0"
										class="cardItem_infosContaines_content_item_title">
										<Countdown :end-time="getdeadline(item.remainder)" type="perOrder"></Countdown>
									</view>
									<view v-if="item.timeout && item.timeout > 0"
										class="cardItem_infosContaines_content_item_title">
										<timeoutCountdown :star-time="getStartline(item.timeout)" type="perOrder">
										</timeoutCountdown>
									</view>
								</view>
							</template>
						</view>
					</view>


					<view class="btnBox" v-if="item.ningboOrderType == 3 || item.ningboOrderType == 1">
						<view class="btn">
							<u-button :disabled="getBtnStatus(1,item)" type="primary" plain size="mini"
								class="custom-style" @click="refundClick(item)">申请退款</u-button>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(2,item)" type="primary" plain size="mini"
								class="custom-style" @click="goDeliveryList(item)">
								寄收快递
							</u-button>
							<u-badge :value="item.expressCount" absolute :offset="[-10,2]"></u-badge>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(3,item)" type="primary" plain size="mini"
								class="custom-style" @click="goDetail(item,4)">
								查看报告
							</u-button>
							<u-badge :value="item.reportCount" absolute :offset="[-10,2]"></u-badge>
						</view>
						<view class="btn" v-if="item.serviceStatus !== 2">
							<!-- <u-button class="custom-style" @click="uploadDigital(item)">补充资料</u-button> -->
							<u-button :disabled="getBtnStatus(4,item)" type="primary" plain size="mini"
								class="custom-style" @click="goDetail(item,2)">补充资料</u-button>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(5,item)" type="primary" plain size="mini"
								class="custom-style" @click="goMessage(item)">医生沟通</u-button>
							<u-badge :value="item.unReadMessageNumber" absolute :offset="[-10,2]"></u-badge>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(6,item)" type="primary" plain size="mini"
								class="custom-style" @click="goInvoice(item)">发票开具</u-button>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(7,item)" type="primary" plain size="mini"
								class="custom-style" @click="goEvaluateServices(item)">评价服务</u-button>
						</view>

					</view>
					<view class="btnBox" v-if="item.ningboOrderType == 2">
						<view class="btn">
							<u-button :disabled="getBtnStatus(5,item)" type="primary" plain size="mini"
								class="custom-style" @click="goMessage(item)">医生沟通</u-button>
							<u-badge :value="item.unReadMessageNumber" absolute :offset="[-10,2]"></u-badge>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(2,item)" type="primary" plain size="mini"
								class="custom-style" @click="goDeliveryList(item)">
								寄收快递
							</u-button>
							<u-badge :value="item.expressCount" absolute :offset="[-10,2]"></u-badge>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(3,item)" type="primary" plain size="mini"
								class="custom-style" @click="detectionReportEvent(item)">
								查看报告
							</u-button>
						</view>
						<view class="btn">
							<u-button :disabled="getBtnStatus(6,item)" type="primary" plain size="mini"
								class="custom-style" @click="goInvoice(item)">发票开具</u-button>
						</view>

					</view>
					<view class="message" @click="goReminder(item)">
						有
						<text class="num"> {{item.unprocessedMessagesNumber}} </text>

						条服务提醒未处理
					</view>


				</view>
				<u-loadmore :status="status" />
				<!-- </scroll-view> -->


			</view>
			<pagesNoData v-else :heightData="contentheightData"></pagesNoData>
		</view>
		<u-modal width='600rpx' showCancelButton :show="modalShow" :content='modalContent' @confirm="confirm"
			@cancel="modalShow=false"></u-modal>
		<u-popup round='20' mode="center" :closeOnClickOverlay='false' :show="rateComVisiable"
			@close="rateComVisiable=false">
			<rateCom :doctorObj="itemObj" @refreshRateEvent='refreshRateEvent' @closeRateEvent='closeRateEvent'
				v-if="rateComVisiable"></rateCom>
		</u-popup>

	</view>
</template>

<script>
	import scrollArticle from '@/components/scrollArticle/scrollArticle.vue'
	import rateCom from '@/components/rateCom/rateCom.vue'
	import Countdown from '@/components/Countdown/Countdown.vue'
	import timeoutCountdown from '@/components/timeoutCountdown/timeoutCountdown.vue'
	import config from '@/config'
	import {
		ordersStatusMap,
		serviceStatusMap,
		ningboOrderTypeMap,
		companyStatusMap,
		uploadAllStatusMap
	} from '@/utils/baseData.js'
	import {
		getOrdersList,
		updateOrdersMainBody
	} from '@/api/platform/orders.js'
	export default {
		name: "pagesMy",
		components: {
			scrollArticle,
			rateCom,
			Countdown,
			timeoutCountdown
		},
		data() {
			return {
				scrollArticleShow: true,
				scrollTop: 0,
				contentheightData: 'calc(100vh - 658rpx)',
				status: 'loadmore',
				total: 0,
				modalShow: false,
				modalContent: '',
				query: {
					page: 0,
					size: 10
				},
				ordersList: [],
				itemObj: {},
				ordersStatusMap: ordersStatusMap,
				serviceStatusMap: serviceStatusMap,
				ningboOrderTypeMap: ningboOrderTypeMap,
				companyStatusMap: companyStatusMap,
				uploadAllStatusMap: uploadAllStatusMap,
				rateComVisiable: false,
			};
		},
		mounted() {
			// #ifdef H5
			if (this.$wx.isWechat()) { // true  微信环境(有导航栏标题)  false  非微信环境(无导航栏标题)
				this.contentheightData = 'calc(100vh - 658rpx)' //(131+118+80)*2  
			} else {
				this.contentheightData = 'calc(100vh - 746rpx)' //(131+118+80+44)*2 
			}
			// #endif
			this.getOrdersList()

		},
		methods: {
			getStepStatus(orderStatus, serviceStatus) {
				if (orderStatus == 3 || orderStatus == 4) {
					return 1
				} else {
					return 2
				}

			},
			getStepsValue(orderStatus, serviceStatus) {
				//
				if (serviceStatus == 5 || serviceStatus == 0) { //未整理 
					return 1
				} else if (serviceStatus == 1) {
					return 2
				} else if (serviceStatus == 2 && orderStatus != 3 && orderStatus != 4) {
					return 3
				} else if (orderStatus == 3) {
					return 4
				} else if (orderStatus == 4) {
					return 5
				} else if (serviceStatus == 2 && orderStatus == 4) {
					return 6
				}
			},
			closeScrollArticle() {
				this.scrollArticleShow = false
			},
			getdeadline(value) {
				// 获取当前时间
				var now = new Date();
				// 当前时间加上200000秒
				now.setSeconds(now.getSeconds() + value);
				// 输出结果
				return now
			},
			getStartline(value) {
				// 获取开始时间
				var now = new Date();
				// 当前时间加上200000秒
				now.setSeconds(now.getSeconds() - value);
				// 输出结果
				return now
			},
			init() {
				this.query.page = 0
				this.query.size = 10
				this.ordersList = []
				this.getOrdersList()
			},
			goDetail(item, current) {
				uni.navigateTo({
					url: `/subPackages/patient/detail/detail?id=${item.id}&current=${current}`
				})
			},
			goReminder(item) {
				this.$store.commit('setDetailObj', item)
				uni.navigateTo({
					url: `/subPackages/my/reminder/reminder?orderId=${item.id}`
				})
			},
			goMessage(item) {
				uni.navigateTo({
					url: `/subPackages/message/history/history?orderId=${item.id}`
				})
			},
			goInvoice(item) {
				this.$modal.showToast('正在开发~')
			},
			goEvaluateServices(item) {
				this.itemObj = item
				this.rateComVisiable = true
			},
			refreshRateEvent() {
				this.rateComVisiable = false
				this.init()
			},
			closeRateEvent() {
				this.rateComVisiable = false
			},
			uploadDigital(item) {
				this.$store.commit('setDetailObj', item)
				uni.navigateTo({
					url: '/subPackages/appointment/uploadDigital/uploadDigital'
				})
			},
			refundClick(item) {
				this.itemObj = item
				this.modalShow = true
				this.modalContent = '您确定申请退款吗?'
			},
			goDeliveryList(item) {
				this.$store.commit('setDetailObj', item)
				uni.navigateTo({
					url: '/subPackages/my/deliveryList/deliveryList'
				})
			},
			detectionReportEvent(item) {
				let baseUrl = config.remoteURL
				let webviewBaseUrl = baseUrl + '/detectionReport'
				this.$u.route({
					type: 'navigateTo',
					url: '/pages/common/webview/index',
					params: {
						url: webviewBaseUrl,
						data: JSON.stringify({
							title: '项目检测报告',
							reportdevice: 'mobile',
							detectionReportId: item.id,
							authorization: this.$store.state.user.token,
						})

					}
				})
			},

			confirm() {
				let data = {
					id: this.itemObj.id,
					ordersStatus: 11
				}
				updateOrdersMainBody(data).then(res => {
					if (res.code == 200 && res.data) {
						this.$modal.showToast('您已成功申请退款，等待管理员处理退款申请')
						this.modalShow = false
						this.ordersList = []
						this.getOrdersList()
					} else {
						this.modalShow = false
					}
				})
			},
			onScroll(e) {
				// 传入scrollTop值并触发所有easy-loadimage组件下的滚动监听事件
				this.scrollTop = e.scrollTop;
				// console.log('onScroll--',e)
			},
			getReachBottom() {
				let that = this;
				this.status = 'loading';
				this.query.page = ++this.query.page;
				setTimeout(() => {
					if (this.ordersList.length < this.total) {
						this.status = 'loadmore'
						that.getOrdersList()
					} else {
						this.status = 'nomore'
					}

				}, 600)
			},
			getOrdersList() {
				getOrdersList(this.query).then(res => {
					if (res.code == 200 && res.rows.content.length > 0) {
						this.total = res.rows.totalElements
						const result = res.rows.content.map((n, index) => ({
							serviceProject: n.institutionServicesInfo.name ? n.institutionServicesInfo
								.name : (n.ningboOrderType ? companyStatusMap[n.ningboOrderType] : ''),
							ageData: n.patients[0].age,
							name: n.patients[0].name,
							ordersStatus: n.ordersStatus,
							ordersStatusText: ordersStatusMap[n.ordersStatus] || '',
							serviceStatusText: serviceStatusMap[n.serviceStatus] || '',
							expressCount: n.expressCount,
							patients: n.patients,
							orderNumber: n.orderNumber,
							receiveWithoutSignInCount: n.receiveWithoutSignInCount,
							serviceStatus: n.serviceStatus,
							sexName: n.patients[0].sexName,
							companyStatus: companyStatusMap[n.companyStatus] || '',
							consultationType: n.ningboOrderType ? ningboOrderTypeMap[n
								.ningboOrderType] : (ningboOrderTypeMap[n.consultationInfoInfo
								.consultationType] || ''),
							id: n.id,
							serialNumber: n.serialNumber,
							unprocessedMessagesNumber: n.unprocessedMessagesNumber,
							serviceCenterName: n.serviceCenterName,
							amount: n.amount,
							orderSource: n.orderSource,
							unReadMessageNumber: n.unReadMessageNumber,
							slicesNumber: n.slicesNumber,
							simpleKindId: n.simpleKindId,
							simplePartId: n.simplePartId,
							contactName: n.patients[0].contactName,
							contactCellphone: n.patients[0].contactCellphone,
							fromTypeId: n.fromTypeId,
							createTime: n.createTime,
							expertId: n.expertId,
							diagnosisTime: this.getValue('diagnosisTime', n), //诊断时间
							diagnosisExpert: this.getValue('expertName', n), //诊断专家
							inviteExperts: this.getValue('inviteExperts', n), //邀请专家
							centerAuditTime: this.getValue('centerAuditTime', n), //中心审核时间
							centerAuditExpert: this.getValue('centerAuditExpert', n), //中心审核专家
							diseaseLocation: this.getdiagnosisValue('diseaseLocation',
								n), //getdiagnosisValue// 疾病部位
							declaration: n.declaration,
							orderId: n.id,
							payDateTime: n.payDateTime,
							ningboOrderType: n.ningboOrderType, //// 1 普通会诊 2 项目检测 3 特需会诊
							serviceCenterId: n.serviceCenterId,
							patientsId: n.patients[0].id,
							reportCount: this.suggestBadge(n.patients[0].expertDiagnosis),
							refreshShow: true, //(this.refreshpageItemIndex == index && this.refreshPageIndex == page && type == 2) ? false : true,
							uploadAllStatus: n.uploadAllStatus,
							remainder: n.remainder,
							timeout: n.timeout,
						}))

						let resultData = result.filter(item => item.ordersStatus != 0)
						this.ordersList.push(...resultData)
						if (this.ordersList.length < this.total) {
							this.status = 'loadmore'
						} else {
							this.status = 'nomore'
						}

					} else {
						this.ordersList = []
						this.status = 'nomore'
					}
				})
			},
			suggestBadge(expertDiagnosis) {

				let opinionTabList = expertDiagnosis
				const isHaveFinalDoctor = expertDiagnosis.some(
					item => item.isFinal == 1
				)
				if (isHaveFinalDoctor) {
					//有终审的医生tab列表
					opinionTabList = opinionTabList.filter(item => {
						return item.isFinished === 1 && item.isFinal == 1 && item.type !==
							1 //(item.type !== 1不显示邀请医生的报告)
					})
				} else {
					//无终审的医生tab列表
					opinionTabList = opinionTabList.filter(item => {
						return item.isFinished === 1 && item.isFinal == 0 && item.type !==
							1 //(item.type !== 1不显示邀请医生的报告)
					})
				}
				return opinionTabList.length || 0
			},
			getdiagnosisValue(value, item) { // 从历史诊断记录里遍历获取对应字段值
				let mRValue = ''
				item.patients[0].diagnosisHistory.forEach(t => {
					if (value == 'diseaseLocation') {
						mRValue = t.diseaseLocation
					}

				})

				return mRValue
			},
			getValue(value, item) {
				let mRValue = ''
				item.patients[0].expertDiagnosis.forEach(t => {
					if (t.type == 0) {
						if (value == 'expertName') {
							mRValue = t.expertName
						}
						if (value == 'diagnosisTime') {
							mRValue = t.expertDiagnosisTime
						}
					}
					if (t.type == 1) {
						if (value == 'inviteExperts') {
							mRValue += t.expertName + ','
						}
					}
					if (t.isFinal == 1) {
						if (value == 'centerAuditExpert') {
							mRValue = t.expertName
						}
						if (value == 'centerAuditTime') {
							mRValue = t.expertDiagnosisTime
						}
					}
				})
				if (value == 'inviteExperts') {
					mRValue = mRValue.substring(0, mRValue.length - 1)
				}
				return mRValue
			},
			getexpertName(item) {
				if (item && item.patients[0]) {
					if (item.patients[0].expertDiagnosis && item.patients[0].expertDiagnosis[0]) {
						return item.patients[0].expertDiagnosis[0].expertName
					} else {
						return ''
					}
				} else {
					return ''
				}
			},
			colorordersStatusType(item) {
				switch (item) {
					//    
					case 1:
					case 4:
						return {
							'background-color': '#fdf6ec', 'border-color': '#00BF5B', color: '#00BF5B'
						} //success
					case 3:
						return {
							'background-color': '#fdf6ec', 'border-color': '#fde2e2', color: '#FF4646'
						} //danger
					case 6:
						return {
							'background-color': '#fdf6ec', 'border-color': '#faecd8', color: '#266EFF'
						} //'warning'
					case 7:
					case 8:
					case 9:
					case 11:
					case 10:
						return {
							'background-color': '#fdf6ec', 'border-color': '#faecd8', color: '#266EFF'
						} //'warning'
					default:
						return {
							'background-color': '#fdf6ec', 'border-color': '#f4f4f5', color: '#999999'
						} //info
				}
			},
			colorType(item) {
				switch (item) {
					case 0:
						return {
							'background-color': '#00BF5B', 'border-color': '#e1f3d8', color: '#FFFFFF'
						} //success
					case 1:
						return {
							'background-color': '#FF4646', 'border-color': '#fde2e2', color: '#FFFFFF'
						} //danger
					case 2:
						return {
							'background-color': '#00BF5B', 'border-color': '#e1f3d8', color: '#FFFFFF'
						} //success
					case 3:
						return {
							'background-color': '#f4f4f5', 'border-color': '#e9e9eb', color: '#266EFF'
						} //info
					case 4:
						return {
							'background-color': '#f4f4f5', 'border-color': '#e9e9eb', color: '#266EFF'
						} //info
					case 5:
						return {
							'background-color': '#FF4646', 'border-color': '#fde2e2', color: '#FFFFFF'
						} //danger
					case 6:
						return {
							'background-color': '#fdf6ec', 'border-color': '#faecd8', color: '#266EFF'
						} //'warning'
					default:
						return {
							'background-color': '#00BF5B', 'border-color': '#e1f3d8', color: '#FFFFFF'
						} //success
				}
			},
			addColorType(item) {
				switch (item) {
					case 0:
						return {
							'background-color': '#fdf6ec', 'border-color': '#fde2e2', color: '#FF4646'
						} //danger
					case 1:
						return {
							'background-color': '#fdf6ec', 'border-color': '#00BF5B', color: '#00BF5B'
						} //success
					case 2:
						return {
							'background-color': '#fdf6ec', 'border-color': '#faecd8', color: '#e6a23c'
						} //danger
					default:
						return {
							'background-color': '#f0f9eb', 'border-color': '#e1f3d8', color: '##67c23a'
						} //success
				}
			},
			getBtnStatus(type, item) {
				if (item.ordersStatus == 11 || item.ordersStatus == 10 || item.ordersStatus ==
					7) { //已申请退款、退款中或者已经退款的 不能进行其他操作
					return true
				}
				if (type == 1) { //申请退款按钮
					if ((item.ordersStatus === 1 || item.ordersStatus === 4) && (item.serviceStatus === 0 || item
							.serviceStatus === 3 ||
							item.serviceStatus === 4 || item.serviceStatus === 5) && (item.amount && item.amount !=
							'0.00')) {
						return false
					} else {
						return true
					}
				} else if (type == 3) { // 会诊报告 serviceStatusText === '诊断结束' || serviceStatusText === '加做诊断中'"
					if (item.serviceStatusText === '诊断结束' || item.serviceStatusText === '加做诊断中') {
						return false
					} else {
						return true
					}
				} else if (type == 4) { //补充资料 serviceStatusText != '诊断结束'
					if (item.serviceStatusText != '诊断结束') {
						return false
					} else {
						return true
					}
				} else if (type == 5) { //医生沟通   serviceStatusText === '加做诊断中' || serviceStatusText === '诊断中'"
					// if (item.serviceStatusText === '加做诊断中' || item.serviceStatusText === '诊断中' || item.serviceStatusText === '诊断结束') {
					//     return false
					// } else {
					//     return true
					// }
					return false
				} else if (type == 6 || type == 7) {
					if (item.serviceStatusText == '诊断结束') {
						return false
					} else {
						return true
					}
				}

			},
		}
	}
</script>

<style lang="scss" scoped>
	.orderItemSteps {
		padding-top: 6px;
		::v-deep .u-steps-item {
			.u-text__value {
				font-size: 20rpx !important;
			}
			
		}
	}
	

	.pagesMy {
		.content {
			.cardBox {
				.cardItem:first-child {
					margin-top: 0rpx;
				}

				// .cardItem {
				// 	position: relative;
				// 	margin: 24rpx 16rpx;
				// 	padding: 16rpx;
				// 	box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.3);
				// 	border-radius: 8rpx;

				// 	.right {
				// 		position: absolute;
				// 		right: 0;
				// 		top: 20rpx;
				// 		padding: 0 10rpx;
				// 		font-size: 24rpx;
				// 		line-height: 32rpx;
				// 		color: #fff;
				// 		background: #ff4543;
				// 		border-radius: 40rpx 0px 0px 40rpx;


				// 	}

				// 	.lineL {
				// 		position: absolute;
				// 		left: 0;
				// 		top: 30rpx;
				// 		width: 6rpx;
				// 		height: 20rpx;
				// 		background: #2a8bef;
				// 		margin-right: 10rpx;
				// 	}

				// 	.orderType {
				// 		display: flex;
				// 		align-items: center;
				// 		font-size: 30rpx;
				// 		line-height: 44rpx;

				// 		.text {
				// 			font-weight: bold;
				// 			text-align: left;
				// 			color: #333333;
				// 		}
				// 	}

				// 	.pay {
				// 		font-size: 24rpx;
				// 		line-height: 32rpx;
				// 		color: #2a8bef;
				// 	}

				// 	.followLine {
				// 		height: 1rpx;
				// 		background-color: #c5c5c5;
				// 		margin: 10rpx 0;
				// 	}

				// 	.first {
				// 		display: flex;
				// 		align-items: center;
				// 		font-size: 24rpx;
				// 		line-height: 40rpx;

				// 		.line {
				// 			width: 1rpx;
				// 			height: 20rpx;
				// 			margin: 0 20rpx;
				// 			background: #a8a8a8;
				// 		}

				// 		.key {
				// 			width: 140rpx;
				// 			color: #666666;
				// 			font-weight: normal;
				// 		}

				// 		.keyValue {

				// 			color: #333;
				// 		}

				// 		.ml {
				// 			margin-left: 10rpx;
				// 		}
				// 	}

				// }
				.redPrice {
					font-size: 28rpx;
					margin: 0 4rpx;
					color: red;
				}

				.color0 {
					background: linear-gradient(180deg, #5DDFFA 0%, #1E68E3 100%);
					color: #ffffff;
					background-clip: text;
					font-weight: 700;
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
					display: inline-block;
				}

				.color1 {
					background: linear-gradient(180deg, #4CE4D5 0%, #0FB6D2 100%);
					color: #ffffff;
					background-clip: text;
					font-weight: 700;
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
					display: inline-block;

				}

				.color2 {
					background: linear-gradient(180deg, #74ADFE 0%, #7E61EF 99%);
					color: #ffffff;
					font-weight: 700;
					background-clip: text;
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
					display: inline-block;

				}

				.color3 {
					background: linear-gradient(180deg, #4CE4D5 0%, #0FB6D2 100%);
					color: #ffffff;
					background-clip: text;
					font-weight: 700;
					-webkit-background-clip: text;
					-webkit-text-fill-color: transparent;
					display: inline-block;
				}

				.cardItem.first {
					margin-top: 0rpx;
				}

				.cardItem {
					position: relative;
					margin: 0 10rpx;
					padding: 16rpx 12rpx;
					box-shadow: 2rpx 2rpx 8rpx 8rpx rgba(32, 108, 228, 0.3);
					border-radius: 8rpx;
					margin-top: 48rpx;
					color: rgba(51, 51, 51, 1);

					&_top {
						display: flex;
						align-items: center;
						justify-content: space-between;
						line-height: 56rpx;

						&_left {
							display: flex;
							align-items: center;

							&_line {
								width: 6rpx;
								height: 32rpx;
								background: rgba(42, 139, 239, 1);
								border-radius: 4rpx;
								margin-right: 8rpx;
							}

							&_title {
								color: rgba(51, 51, 51, 1);
								font-size: 28rpx;
								font-weight: 600;
							}
						}

						&_right {
							display: flex;
							align-items: center;

							&_btn {
								padding: 0 6rpx;
								border-radius: 6rpx;
								margin-right: 8rpx;
								line-height: 40rpx;
								font-size: 26rpx;
								transform: scale(0.9);
								border: 2rpx solid #fff;
							}

							&_btn:last-child {
								margin: 0rpx;
							}

						}
					}

					&_price {
						color: rgba(42, 139, 239, 1);
						font-size: 28rpx;
						line-height: 40rpx;
						padding-left: 12rpx;
					}

					&_infosContaines {
						padding: 20rpx 12rpx;
						font-size: 26rpx;

						&_content {
							border-top: 2rpx solid rgba(197, 197, 197, 1);
							padding-top: 20rpx;

							&_item:first-child {
								margin-top: 0rpx;
							}

							&_item {
								margin-top: 10rpx;
								display: flex;
								font-size: 26rpx;
								line-height: 40rpx;

								&_label {
									color: #666666;
									width: 140rpx;
									margin-right: 12rpx;
								}

								&_title {
									color: #111111;

									&_infos {
										display: flex;
										flex-wrap: wrap;
										align-items: center;

										&_name {
											font-weight: 700;
										}

										&_line {
											width: 2rpx;
											height: 20rpx;
											background: rgba(168, 168, 168, 1);
											margin: 0 10rpx;
										}
									}
								}
							}
						}

					}


				}





				.btnBox {
					display: flex;
					flex-wrap: wrap;
					// margin-top: 30rpx;

					.btn {
						// width: calc((100% - 10px) / 4);
						padding: 0 10rpx;
						margin-bottom: 20rpx;
						position: relative;

						.custom-style {
							font-size: 26rpx;
							line-height: 44rpx;
							text-align: center;
							color: #3898FF;

						}

						.redText {
							color: red;
							font-weight: bold;
							margin-left: 10rpx;
						}
					}
				}

				.message {
					background: #fff4e4;
					border-radius: 5px;
					font-size: 32rpx;
					line-height: 48rpx;
					color: #E9702E;
					padding: 0 20rpx;

					.num {
						font-size: 40rpx;
						margin: 0 10rpx;
						color: red;
						font-weight: bold;
					}
				}

				.btnBox1 {
					display: flex;
					justify-content: center;

					.btn1 {
						margin-right: 40rpx;
					}
				}

				.person {
					margin-right: 30rpx;
				}
			}
		}
	}
</style>